<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Unit Test: Textile</title>
    <script type="text/javascript" src="../scripts/dd/dd.js"></script>
    <script type="text/javascript">
    dd({
        modules:[
            "control",
            "textile",
            "textile.editor"
        ]
    }).event({
        load:function()
        {
            dd(dd.body).empty();
            var text = dd(dd.body).addElement("textarea");
            dd(text).css({
                border:"1px solid #DDD",
                width:"500px",
                height:"200px"
            });
            dd(text).value = "h1. Starting Text1 Text2 Text3 Text4";
            var button = dd(dd.body).addElement("input", {value:"Convert", type:"button"});
            dd(dd.body).addElement("hr");
            var content = dd(dd.body).addElement("div");
            dd(button).event({
                click:function()
                {
                    var v = dd(this.text).value;
                    dd(this.content).textile({
                        text:v
                    });
                }
            }, {text:text, content:content});
            dd(dd.body).addElement("hr");
            var textile = dd(dd.body).addControl("textile.editor");
            dd(textile).text = "h1. Starting Text1 Text2 Text3 Text4\n\np. On a New Line Text1 Text2 Text3 Text4";
        }
    });
    </script>
</head>
<body>
    Loading...
</body>
</html>
